package InterfaceHomewordTest1;

public class Cylinder implements C{
    private double radius;
    private double height;
    private String color;

    public Cylinder() {
    }

    public Cylinder(double radius, double height, String color) {
        this.radius = radius;
        this.height = height;
        this.color = color;
    }



    public void volume(){
        double volume = radius * radius * PI * height;
        System.out.println("体积是"+volume);
    }

    public void setColor(String c){
        this.color = c;
    }

    public double area(){
        double area = (2 * PI * radius * height) + 2 *(radius * radius * PI);
        return area;
    }

}
